package com.qihetimes.earthangel.controller;

import com.qihetimes.earthangel.common.ResponseResult;
import com.qihetimes.earthangel.common.annotation.NoLogin;
import com.qihetimes.earthangel.service.impl.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 短信
 *
 * @author ：f4cklangzi@gmail.com
 * @date ：Created At 2021/12/9
 */
@Slf4j
@Api(tags = "短信模块")
@RestController
@RequestMapping("/api/sms")
public class SmsController {
    
    @Resource
    private SmsService smsService;
    
    @NoLogin
    @ApiOperation(value = "发送短信验证码")
    @PostMapping("/send")
    public ResponseResult<String> send(@RequestParam String phone) {
        smsService.send(phone);
        return ResponseResult.success();
    }
    
    
}
